#pragma once
#include "KinectLib.h"

// class SkeletonAnalysis
class SkeletonAnalysis
{
public:
    SkeletonAnalysis();
    virtual ~SkeletonAnalysis();

public:
    void analysisRepeatCount(KinectLib *pKinect, int width, int height, const NUI_SKELETON_FRAME &frame);
    void resetRepeatCount();
    // s : [0 ~ 5], p : [0 ~ 19], d : [0 ~ 1]
    int  getRepeatCount(int s, int p, int d, bool isLow);

private:
    struct RepeatContext
    {
        int minPoint;
        int maxPoint;
        int lastPoint1;
        int lastPoint2;
        int lowCount;
        int highCount;
    };

    void initRepeatLimit();
    void resetRepeatContext(RepeatContext &rc);

private:

    // [0] - X,  [1] - Y
    RepeatContext   mRepeats[NUI_SKELETON_COUNT][NUI_SKELETON_POSITION_COUNT][2];
    // 0.0 ~ 1.0
    double          mRepeatLimit[NUI_SKELETON_POSITION_COUNT][2];


};